package com.blue.base.oauth.common.bean;

import com.blue.base.common.utils.date.LocalDateUtils;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * @author liulei
 * @version 1.0
 */
@Data
@Builder(toBuilder = true)
@AllArgsConstructor
@NoArgsConstructor
public class RefreshTokenRecord implements Serializable {
    /**
     * 刷新token记录的key
     */
    private String recordKey;
    /**
     * accessToken
     */
    private String accessToken;
    /**
     * accessToken过期时间
     */
    private Date tokenExpires;
    /**
     * 记录刷新token的时间
     */
    private Long recordDate;

    /**
     * 返回描述信息，便于调测
     */
    public String getExpiresDescribe() {
        return LocalDateUtils.dateConvertToString(tokenExpires,
                LocalDateUtils.DATE_TIME_FORMAT);
    }
}
